/*
 *   Copyright 2008 Luca Bellonda <lbellonda@gmail.com>
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Library General Public License as
 *   published by the Free Software Foundation; either version 2 or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details
 *
 *   You should have received a copy of the GNU Library General Public
 *   License along with this program; if not, write to the
 *   Free Software Foundation, Inc.,
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef DBUSAPPLETITEM_H
#define DBUSAPPLETITEM_H

#include <QVector>
#include <QString>
#include <QMetaType>

class DBusAppletItem
{
public:
    QString id;
    QString idParent;
    QString type;
    QString data;
    QVector<DBusAppletItem*> childs ;
    DBusAppletItem * lastInserted;
    //---
    DBusAppletItem();
    DBusAppletItem(const DBusAppletItem &t);
    DBusAppletItem(const int p_id, const int p_idParent, const QString &p_type, const QString &p_value);
    ~DBusAppletItem();

    QString toString();
    DBusAppletItem *append(const int id, const int idParent, const QString &type, const QString &value);
    void clear();
    DBusAppletItem *last() {
        return lastInserted;
    }
    DBusAppletItem& operator=(const DBusAppletItem& t);
    int total();
};

Q_DECLARE_METATYPE(DBusAppletItem);


#endif /* DBUSAPPLETITEM_H */